<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../WEB-INF/facelets/layout.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:param name="title" value="Show Post"/>
    <ui:param name="headerTitle" value="Show Post"/>
    <ui:define name="content">
         <f:metadata>
            <f:viewParam name="userId" value="#{showUserViewBean.id}"/> 
        </f:metadata>

        <h:outputText value="#{showUserViewBean.user.userName}" style="font-size: 4em"/>
        <br/>
        <br/>
        <h3> Posts </h3>
            
        <c:forEach items="#{showUserViewBean.user.posts}" var="post">
            <h:outputText value="#{post.title}" style="font-size: 2em"/>  

            <br/>
            #{post.postPreview}
            <hr/>
            <br/>
        </c:forEach>
        <h3> Comments </h3>
        <c:forEach items="#{showUserViewBean.user.comments}" var="comment">
            By: <h:outputText value="#{comment.commentAuthor.userName}" style="font-weight: bold"/><br/> #{comment.comment}
            <br/>
               <hr/>
            <br/>
        </c:forEach>



    </ui:define>
</ui:composition>

